package com.woniuxy.qiantai.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000122611881";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCkzUlxLmVxpVREPlUTHqBdDneQfx1peQvMaCHpKyxayBNFoO2ZGdpHoT3CCyyMb8ifrCT+YCfr2F4XcAzwfydVlvFZe3i51YguAuxixXngA5qx88oR9EfYlUKDm+p2wW+phRv1mhNd5k9XKXST9Abb2gvaj5D1zVHHLXJunZdH+dNSfQ/bcPpcT/mKqzJMc9/tRGKR2536hpnXpQKx0OKQmh+TzncEtk0uvoi1n0BF7retkp5jelUZSaJWZV3h+dvsQx/F4zAq5LAF+SkEImFzpgckbUpg8EgKnYzkhQrRnS3afdHI5hdQKsAoHe6C761xGVbmzrtrhj7///oyWxBHAgMBAAECggEAcbOxGAWKt/35RZw71hUrTwjMNUV+ZWa+XSj7PIQs9fVUVpXRV/AeSY1VrqtG8R2urXt3iomNAYsmX8VPKB6SZNrfaX1mrdBFRHl/3iWhEI1sDZrFr916NFPGsEbCXWzYPX047RqAgiiEVP6lD+8tTEIEK6chvHUMFv+kE+1mkqEOQ7y27DpHUMLD7dJ0d6eN5eBXsZkp6vJF2/WmdRirCA6l4JDCTfAI9jJcGdnmni7On181Gf4gd8+evLFu6L7wKVZUtPbeQA2v5m7U5fAziwcjHTeKGmwU6DMtUIUZRRhhqptQZwebExGtAW3BiHPQf3WhcIi4TI0/7WpwP9p8AQKBgQDgVk4PXJfvN8AtMiWThSJXqJmFwHrRA5E/lAQSD/6euRDC91Jws7uudQrRfnEg3LqvgvixbQpskORThJk6+718BVqILgUHCquLldhzXeermsLKP0SreY99S9wj213He72vR4hfRM3y9o8mHAVrLBlr5ICGIDyqtmTnnF3SsLqrkQKBgQC8D96XLqvSAp/8oCP0PGFDWIQa2/jU6cEUQAfVZSH7L83yuBN4dr2dmmKgf+NLezMNs9p9N166Y+N1hW5nPDcpI+1+tVVyMNLekmCCcMD/bmMRNRZH1pWbtL7AhbKH8Wb5kyg0XBmUWKE3vgoAliCT3+cT9OTP6F8NI0H2tkmiVwKBgGLGnWg2JM+3hG5h/hmOLSjbm31A2tLc9z8/NOufD0VjxvWRYEMvYBvYfQLw4W7OwYQ17rpwgH587Yu4fp9x6GSLFumPGbeYAyBawgtJ9Y+hfNMAOIQn6f4JQMyo8gm7ejGLFYidCvFHjpABFoGx0R+oZM6pswyXcqZoOwdhuU+BAoGAOqacXfwBPBrzeF8dN3OJRe6aLKJD5WsNe1pI1yWWRndvPG5qLBykID3g2ntoEMdYccKQtpKJKYozixhVCT8/WMZKsESvZFCTwzRVgvjVSBROMzSiQT9MI2ZoQzSvLDR+UAGz/ThoBdrqVK8hAXPQry2aLKAoqCqpUjiXvvC04DsCgYBZYjjrBp8SHd51DOoK/SnaMCfeAJY9tW9zc8pGbpP9PftugmbiWbJy628PIRkRbRlcZfVa6VU/EYbLyNlExoKJknO1Lck4WulWu+e3fJZXURkNNl7zBozyWLQMLQbQBqFjZkpFeymH1ZlIflbVmg3pzM9YmibMZUUE5FTZLVmkbQ==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw1gw9mU1AJeFhSHIb5cl5Mw3PVTUx2ERnbvG0kc4Qun67QN/BYPRd7mPi4zvbLOEBlj/KMR89saAkcm6UOdOQyW3+vTtHV2NC7asTIZpLXHeygTzferbecy2mnKSdBuzTeUvX3iH6w/tqmFjwJ841h1LPm6fTp7r025BfF31OK8EgQxAHBz+rmVCqDy9u5s1nlroG/37Vjhz/9+ZJiaXEhhztyByb9Pcp73buFabIBdn17b/hsjuf17pHhJ1tT5V7SXLRm7d2wLuvAQufdYGO7OoKgEaJHfmVJzSFJfxLPXCwmca26G2/DkagT3cOxNrD/mT/8kthPRVcglDEh9xNQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8080/notify_url";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/return_url";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

